package com.twotiger.and.activity;

import app.twotiger.p2p.R;

import com.twotiger.and.activity.account.AccountPage;
import com.twotiger.and.activity.base.BaseFragment;
import com.twotiger.and.activity.base.BaseHandler;
import com.twotiger.and.activity.current.CurrentPage;
import com.twotiger.and.activity.others.MorePage;
import com.twotiger.and.activity.project.Projectpage;

/**
 * @Description: 
 * fragment 工厂
 * @Author douxy
 * @Date 2015年8月10日 下午5:09:19
 */
public class FragmentFactory {

    private static BaseFragment jinpin = new BoutiquePage();
    private static BaseFragment project = new Projectpage(); //项目列表
    private static BaseFragment account = new AccountPage();
//    private static BaseFragment more = new MorePage();
  private static BaseFragment current = new CurrentPage();


    private static BaseFragment systemUpgrade = new SystemUpgradePage();

    public static BaseFragment getInstanceByBtnID(int btnId) {
        BaseFragment fragment = null;
        switch (btnId) {
        case R.id.radio_btn1:
            fragment = jinpin;
            break;
        case R.id.radio_btn2:
            fragment = project;
            break;
        case R.id.radio_btn3:
            fragment = current;
            break;
        case R.id.radio_btn4:
            fragment = account;
            break;
        case BaseHandler.SYSTEM_UPGRADE:  //系统升级的fragment
            fragment = systemUpgrade;
            break;

        }
        return fragment;
    }

}
